package ac.manchester.cs.afzal.term_classifier.miscellaneous;

import java.io.File;
import java.net.URL;

/**
 * File_Manager class contains the methods to perform generic operations
 * on files including the read/write/download the files when URL is given.
 *
 * @author Hammad Afzal
 * @version 1.0
 */
public interface File_Manager
{
    /**
     * Reads the file from given path and put the contents into StringBuffer
     * @param input_path
     * @return
     */
    public StringBuffer fileReader(String input_path);

    /**
     * Reads the given input file and put the contents into StringBuffer
     * @param inputFile
     * @return
     */
    public StringBuffer fileReader(File inputFile);


    /**
     * Downloads the file from given string url_string and writes it into the output_path
     * @param url_string
     * @param output_path
     */
    public void fileDownloader(String url_string, String output_path);
    /**
     * Downloads the file from given URL and writes it into the output_path
     * @param url
     * @param output_path
     */
    public void fileDownloader(URL url, String output_path);
    /**
     * Writes the given StringBuffer in a file whose path is given as input
     * @param stringBuffer
     * @param output_path
     */
    public void fileWriter(StringBuffer stringBuffer, String output_path);
    /**
     * Writes the given String in a file whose path is given as input
     * @param str
     * @param output_path
     */
    public void fileWriter(String str, String output_path);

    /**
     * Returns the file name without extension
     * @param inputFileString
     * @param extension
     * @return
     */
    public String strip_file_name_from_file_name_plus_extension(String inputFileString, String extension);

    /**
     * Returns the file name without extension
     * @param inputFileString
     * @param extension
     * @param delimiter
     * @return
     */
    public String strip_file_name_at_extension(String inputFileString, String delimiter);

    /**
     * Returns the extension of the input file
     * @param inputFile
     * @return
     */
    public String strip_extension_from_file_name(String inputFile);
}
